package com.yk.airline.process;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

/**
 * Project Name:airlinecrawler
 * File Name:WebTask
 * Package Name:com.yk.airline.process.feizhu
 * Date:2018/1/29 17:56
 * Author:zhangshaoyang
 * Description:
 * Copyright (c) 2018, 重庆云凯科技有限公司 All Rights Reserved.
 */
@EnableScheduling
@Component
public class WebTask {
    //每5秒执行一次
    @Scheduled(cron = "0 7/1 * * * ? ")
    public void taskJob() {
        System.out.println("任务执行时间:" + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(System.currentTimeMillis()));
    }
}
